<script setup lang="ts">
const { setLoading } = useStatusStore();

setLoading(true);
const [{ data: postList }, { data: userList }] = await Promise.all([
  useAsyncData("post-list", () => $get<Post[]>("/posts")),
  useAsyncData("user-list", () => $get<User[]>("/users")),
]);
setLoading(false);
</script>

<template>
  <ul v-if="postList && userList">
    <PostItem v-for="p in postList" :post="p" :users="userList" :key="p.id" />
  </ul>
</template>
